import axios from "axios"
axios.interceptors.request.use(req=>{
  if(localStorage.LoginToken){
    //浏览器将带有token的请求发送到服务器端
    req.headers.Authorization=localStorage.LoginToken
  }
  return req
})
axios.interceptors.response.use(res=>{
  // if(res.data)
  return res
},err=>{
  console.log(err)
    
})

axios.defaults.baseURL="http://localhost:3001/api"


axios.defaults.timeout=1800000
export default axios